package com.zh.auth.service;

import com.zh.auth.domain.dto.LoginDto;
import com.zh.auth.domain.dto.RegisterDto;
import com.zh.common.dto.IpDto;
import com.zh.web.domain.auth.vo.UserVo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

public interface AuthService {
    /**
     * 获取公钥
     * @return
     */
    String getPublicKey();

    /**
     * 获取私钥
     * @return
     */
    String getPrivateKey();

    /**
     * 登录
     * @param request
     * @param response
     * @param loginDto
     * @param ipDto
     * @return
     * @throws Exception
     */
    UserVo login(HttpServletRequest request, HttpServletResponse response, LoginDto loginDto, IpDto ipDto) throws Exception;
    UserVo login(LoginDto loginDto, HttpServletResponse response, IpDto ipDto) throws Exception;
    String register(RegisterDto registerDto);
    String refreshToken(HttpServletRequest request, HttpServletResponse response);
    Map<String,Object> getUserSessionByToken(String token);
    String invalidateToken(String authToken);


    Boolean checkToken(String authToken);
}
